/**
 * Created by Germmy on 2018/2/3.
 */
import entity.MyConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@ComponentScan(basePackages = {"entity"})
@RestController
@EnableAutoConfiguration
@SpringBootApplication
public class Example {

    @Autowired
    private MyConfig myConfig;

    @RequestMapping("/")
    String home() {
        return "Hello World!";
    }


    @RequestMapping("/myConfig")
    String myConfig() {
        return myConfig.getMyServerUrl();
    }

    public static void main(String[] args) throws Exception {
        SpringApplication.run(Example.class, args);
    }

}